import random


def print_info(var, name):
    if var == 1:
        print('%s 出的石头' % name)
    elif var == 2:
        print('%s 出的剪刀' % name)
    elif var == 3:
        print('%s 出的布' % name)


# 石头剪刀布
while True:
    # my_var
    print('游戏开始了')
    my_var = int(input('请输入你要出的类型: 1 石头,2 剪刀, 3 布'))
    com_var = random.randint(1, 3)

    #       石头  剪刀 布
    # my_var  1    2   3
    # com_var 1    2   3

    #  赢   -1 , 2
    # 平   0
    # 输   1  , -2
    # print_info(my_var, '玩家')
    # print_info(com_var, '电脑')

    # dict1 = {
    #     1: '石头',
    #     2: '剪刀',
    #     3: '布'
    # }
    # print('玩家出的是', dict1.get(my_var))
    # print('电脑出的是', dict1.get(com_var))
    list1 = ['石头','剪刀','布']

    print('玩家出的是',list1[my_var-1])
    print('电脑出的是',list1[com_var-1])

    reult = my_var - com_var
    if reult == -1 or reult == 2:
        print('玩家获胜!')
    elif reult == 0:
        print('平局')
    elif reult == 1 or reult == -2:
        print('电脑获胜!')
